package Extend;

import java.util.Scanner;

/*
    请设计程序模拟敏感词过滤：使用键盘录入模拟弹幕评论，
    将录入的数据进行处理，
    要求不能出现：sb，tmd，傻蛋等字眼（这里字母不区分大小写匹配），
    如果出现了，则使用**代替，将过滤后的内容打印到控制台
 */
public class Ex02 {
    public static void main(String[] args) {
        //字符库
        String[] word = {"sb","SB","Sb","sB","tmd","Tmd","tMd","tmD","TMd","tMD","TmD","TMD","傻蛋","sha蛋","傻dan"};
        System.out.println("请输入");
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        for (int i = 0; i < word.length; i++) {
            s = s.replace(word[i], "***");
        }
        System.out.println(s);

    }
}
